Release 10.1A: OpenEdge Development:
Programming Interfaces
Importing and exporting data
Sometimes you send data to a file knowing that it will be used later by a Progress procedure. If so, then you also know that the data file must be in standard format with character fields surrounded by quotes. Therefore, instead of just redirecting the output to the file and using the DISPLAY statement to send output to that file, you might use the
Note: Do not confuse theEXPORTstatement.EXPORTstatement with theEXPORTmethod of theSESSIONhandle. TheEXPORTstatement converts data from one format to another while redirecting it. TheEXPORTmethod of theSESSIONhandle adds procedure names to the export list (list of procedures a requesting procedure can access) of a OpenEdge AppServer. For more information on OpenEdge AppServers, see OpenEdge Application Server: Developing AppServer Applications .Using the EXPORT statement
The
EXPORTstatement sends data to a specified output destination, formatting it in a way that can be easily used by another Progress procedure. For example,i-export.pwrites customer information to a file:
The output from
i-export.pis written toi-datfl6.d:
Now this file is ready to be used as an input source by another Progress procedure. There is no need to process it through
QUOTER.By default, the
EXPORTstatement uses the space character as a delimiter between fields. You can use theDELIMITERoption of theEXPORTstatement to specify a different delimiter.For example,
i-exprt2.pwrites to a file in which field values are separated by commas:
The output from
i-exprt2.pis written toi-datfl7.d:
You can read this file by using the
DELIMITERoption of theIMPORTstatement. More likely, you would prepare a file like this to be read by another application.For more information on the
EXPORTstatement, see the OpenEdge Development: Progress 4GL Reference .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |